#pragma once
#ifndef EDITORWIN_H
#define EDITORWIN_H

#include<QWidget>
#include<QtGui>
#include<QDebug>
#include<QGraphicsScene>
#include<QGraphicsView>
#include<QGraphicsItem>
#include<QGraphicsTextItem>
#include<QVBoxLayout>
#include<QPushButton>
#include<QBrush>
#include<QTextEdit>
#include<QGraphicsProxyWidget>
#include<QString>
#include<QFile>
#include<QApplication>
#include<QGraphicsWidget>

#include"editor_view.h"
#include"node_scene.h"
#include"node_edge.h"



class EditorWin : public QWidget
{
    Q_OBJECT

public:
    EditorWin(QWidget *parent = nullptr);
    ~EditorWin();

    void AddDebugContent();
    void addNodeItem(int index);
    void SetNodeTitle(int index, QString title);
    void LoadStyleSheet(QString filename);
    void DebugNode();
    void AddEdge(int start_node_index,int start_socket_index,int end_node_index,int end_socket_index);
    void RemoveEdge(int start_node_index,int start_socket_index,int end_node_index,int end_socket_index);


//    QPointF mouse_start_pos = QPoint(0,0);
//    QPointF mouse_end_pos = QPoint(0,0);


    QVector<NodeScene*> node;
    QVector<NodeEdge*> edges;
    NodeEdge *edge;

    QVBoxLayout *layout;
    EditorView *view;
    EditorScene *editorScene;
    QGraphicsItem *item;
private:

    //NodeScene *nodeScene;

    QString filename;

};
#endif // EDITORWIN_H
